﻿<UserControl x:Class="MediaBrowserSL.RIA.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:jadeControls="http://www.sebastien-alves.fr/jadeToolsSLControls"
    xmlns:Converters="clr-namespace:MediaBrowserSL.RIA.Converters"
    xmlns:ConvertersJulmar= "clr-namespace:JulMar.Silverlight.Converters;assembly=JulMar.Siverlight.Helpers" 
    d:DesignHeight="768" d:DesignWidth="1024">

    <UserControl.Resources>
        <Converters:ViewModelViewConverter x:Key="ViewModelViewConverter"/>
        <ConvertersJulmar:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <ConvertersJulmar:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter2" />
    </UserControl.Resources>

    <UserControl.DataContext>
        <Binding Mode="OneWay" Path="Main" Source="{StaticResource Locator}"/>
    </UserControl.DataContext>

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#FF12475D" Offset="0.014"/>
                <GradientStop Color="Black" Offset="1"/>
                <GradientStop Color="#FE28799F" Offset="0.512"/>
                <GradientStop Color="#FE174E66" Offset="0.573"/>
                <GradientStop Color="#FE16333F" Offset="0.293"/>
                <GradientStop Color="#FE0F1B20" Offset="0.78"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="60"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="45"/>
        </Grid.RowDefinitions>

        <Grid HorizontalAlignment="Stretch" Grid.Row="0">
            <sdk:Label x:Name="label" Content="Media Browser"  FontFamily="Calibri" FontSize="32" Background="{x:Null}" FontWeight="Bold"
				   Margin="10,0,0,0" HorizontalAlignment="Left">
                <sdk:Label.Effect>
                    <DropShadowEffect/>
                </sdk:Label.Effect>
                <sdk:Label.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF1B2326" Offset="0"/>
                        <GradientStop Color="#FF629FB9" Offset="1"/>
                        <GradientStop Color="#FFD8DFE2" Offset="0.488"/>
                    </LinearGradientBrush>
                </sdk:Label.Foreground>
            </sdk:Label>
        </Grid>

        <StackPanel Grid.Row="0" HorizontalAlignment="Right">
            <jadeControls:ImageButton 				
        				Width="16" Height="16" Visibility="{Binding IsFullScreenCommandVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
        				Source="/MediaBrowserSL.RIA;component/Images/full screen_16.png" Command="{Binding FullScreenCommand}" VerticalAlignment="Top" Margin="0,5,5,0" HorizontalAlignment="Right" />
        </StackPanel>

        <jadeControls:TranslateTransitionElement x:Name="TransitionBox" Grid.Row="1" 
                                                               ContentTransition="{Binding CurrentContent, Converter={StaticResource ViewModelViewConverter}}"
                                                               IsGoForward="{Binding IsGoForwardView}"
                                                               Visibility="Visible"
                                                               Margin="30,6,30,6">
        </jadeControls:TranslateTransitionElement>

        <Border Grid.Row="2" Background="{StaticResource DefaultedBorderBrush}" CornerRadius="2" 
                Margin="0" Padding="0,2">
            <Grid Margin="0">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0">

                    <jadeControls:ImageButton 				
        				Margin="3,3,30,3" 
        				Source="/MediaBrowserSL.RIA;component/Images/Backward.png" Command="{Binding BackwardViewCommand}"/>

                    <jadeControls:ImageButton 				
        				Margin="3,3,30,3" 
        				Source="/MediaBrowserSL.RIA;component/Images/home.png" Command="{Binding HomeViewCommand}"/>

                    <jadeControls:ImageButton 				
        				Margin="3,3,0,3" 
        				Source="/MediaBrowserSL.RIA;component/Images/Forward.png" Command="{Binding ForwardViewCommand}"/>

                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,15,0">

                    <Button Command="{Binding SettingCommand}"
                         Style="{StaticResource ButtonStyleNav2}" 
                        Width="34" Height="24" Content="@" BorderThickness="0" Margin="0,0,5,0" FontFamily="Webdings" ToolTipService.ToolTip="Espace Serveur" />

                    <Button Command="{Binding AboutCommand}"
                         Style="{StaticResource ButtonStyleNav2}" 
                        Width="34" Height="24" Content="?" BorderThickness="0" Margin="0,0,5,0" ToolTipService.ToolTip="A propos"/>


                    <Button Command="{Binding LogOutCommand}"
                            Style="{StaticResource ButtonStyleNav2}" 
                            Visibility="{Binding ViewLogOut, Converter={StaticResource BooleanToVisibilityConverter2}}"
                            Width="34" Height="24" Content="y" BorderThickness="0" FontFamily="Webdings" ToolTipService.ToolTip="Quitter"/>

                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
